put INITList("Detailed", "noDialog:errGlobal") into INITInfo
if errGlobal Γëá empty then
answer "Error: ΓÇ£" & errGlobal & "ΓÇ¥"
put empty into errGlobal
else
put INITInfo into cd fld "init list"
end if
end mouseUp
-- part 4 (button)
-- low flags: 00
-- high flags: A002
-- rect: left=130 top=292 right=326 bottom=233
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 8192
-- line height: 16
-- part name: All Files Reported
----- HyperTalk script -----
on mouseUp
global errGlobal
set cursor to watch
put INITList("", "noDialog:errGlobal") into INITInfo
if errGlobal Γëá empty then
answer "Error: ΓÇ£" & errGlobal & "ΓÇ¥"
put empty into errGlobal
else
put INITInfo into cd fld "init list"
end if
end mouseUp
-- part contents for background part 38
----- text -----
26/50
-- part contents for background part 20
----- text -----
An XFCN which scans the System Folder of the system startup volume for files of type 'INIT' and 'RDEV' and 'cdev' and returns the names of all files in a carraige return delimited list. All control characters in file names (ASCII value less than 32) are represented by period ('.').
If nothing is passed as the first parameter, all files of these types will be listed. If the literal string ΓÇ£DETAILEDΓÇ¥ is passed as the first parameter, each file will be opened to see if it contains a resource of type INIT . In this case, the file name will not be returned unless an INIT resource is found. Opening all files will take longer. On my system ΓÇ£DETAILEDΓÇ¥ takes 30 ticks to report 19 files, compared with 10 ticks to list 29 files (Mac IIx).
DETAILED: open all files to make sure that they contain a resource of type INIT.
NOTE: The list of INITs reported by this XFCN may not exactly represent the list of INITs actually run at startup time on systems which use one of the INITs which change the order of INIT loading without changing file type ie. ΓÇ£INITPickerΓÇ¥, ΓÇ£INITHoundΓÇ¥, etc. In such a case the list may contain the names of more files than actually ran at startup.
-- part contents for background part 42
----- text -----
unit INITFinder;
{}
{ At startup the system scans the System Folder of the system}
{ startup volume for files of type 'INIT' and 'RDEV'. When it finds }
{ it opens the file and calls all resources of type 'INIT'. We mimic }
{ this process, but just return the names of all files. }
{}
{ brought to you by: Anup Murarka Eric Carlson }
{ ALINK: SKEPTIC ALINK: cyNic }
{ CIS: 76004,3356 }
{}
{ We are part of the Support Tools Development Group, }
{ Apple Computer, Inc. }
{}
{ please DO NOT contack Mac DTS for support of this code! }
{}
{ please DO contact the authors for support of this code! }
{}
{ Send comments, bug reports, requests to any of the above }
{ E-mail addresses or to:}
{}
{ (one of us) }
{ Apple Computer, Inc. }
{ 900 E. Hamilton, Ave. }
{ Campbell, CA 95008 }
{ M/S 72-L }
{}
{ Copyright: © 1989, 1990 by Apple Computer, Inc., all rights reserved. }
{ Get the vrefnum of the directory containing the open System file. }
{ We will use this in our OpenRFPerm call since we don't have (or need) }
{ the full path name to the system folder. }
errorCode := SysEnvirons(2, sysRec);
if errorCode <> noErr then
begin
reportResError(paramPtr, errorCode);
exit(INITFinder);
end;
systemVRefNum := sysRec.sysVRefNum;
with ourHFSBlock.HBlock do
begin
ioCompletion := nil;
ioNamePtr := nil;
ioVRefNum := systemVRefNum;
ioVolIndex := 0;
end;
errorCode := PBHGetVInfo(@ourHFSBlock, false);
if errorCode <> noErr then
begin
reportResError(paramPtr, errorCode);
exit(INITFinder);
end;
SysFolder := ourHFSBlock.HBlock.ioVFndrInfo[1];
with ourHFSBlock.WDBlock do
begin
ioWDDirID := SysFolder;
ioCompletion := nil;
ioNamePtr := nil;
ioVRefNum := systemVRefNum;
end;
with ourHFSBlock.InfoBlock do
begin
ioCompletion := nil;
ioNamePtr := nil;
ioVRefNum := systemVRefNum;
ioFDirIndex := -1;
ioDrDirID := SysFolder;
end;
errorCode := PBGetCatInfo(@ourHFSBlock, false);
if errorCode <> noErr then
begin
reportResError(paramPtr, errorCode);
exit(INITFinder);
end;
nameList := NewHandle(0);
errorCode := MemError;
if errorCode <> noErr then
begin
reportResError(paramPtr, errorCode);
exit(INITFinder);
end;
{ Use PBGetCatInfo to determine the number of files and folders}
{ in the System folder. }
FileCount := ourHFSBlock.InfoBlock.ioDrNmFls;
MoveHHI(nameList); { lock down the list }
{ Now index through the System folder, calling PBGetCatInfo for }
{ each object within it. Check the attributes to see if it is a folder. }
{ If it is not, then see if the file is of type INIT, cdev, or RDEV. }
{ If it is one of these types and we are supposed to be making a }
{ list, open the resource fork and look for a resource of type INIT. }
{ If one is found, report the name of the file}
for index := 1 to FileCount do
begin
fName := '';
with ourHFSBlock.InfoBlock do
begin
ioCompletion := nil;
ioNamePtr := @fName;
ioVRefNum := systemVRefNum;
ioFDirIndex := index;
ioDirID := SysFolder;
end;
errorCode := PBGetCatInfo(@ourHFSBlock, false);
if errorCode <> noErr then
begin
reportResError(paramPtr, errorCode);
goto 10;
end;
if not BitTest(@ourHFSBlock.InfoBlock.ioFlAttrib, 8, 4) then { not a directory }
if (ourHFSBlock.InfoBlock.ioFlFndrInfo.fdType = 'INIT') or (ourHFSBlock.InfoBlock.ioFlFndrInfo.fdType = 'cdev') or (ourHFSBlock.InfoBlock.ioFlFndrInfo.fdType = 'RDEV') then
begin
if detailStr = 'DETAILED' then { open every file and look for 'INIT' resources }